<!DOCTYPE html>
<html lang="zh-Hans">

<!-- Head tag -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--Description-->
    
        <meta name="description" content="Note">
    

    <!--Author-->
    
        <meta name="author" content="兰陵忧患生">
    

    <!-- Title -->
    
    <title>Interface Problem | Lan</title>

    <!-- Bootstrap Core CSS -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet"
      href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/default.min.css">
    <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/css/style.css">

    <!-- Custom Fonts -->
    <link href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

    <!-- Content -->
    <section class="article-container">
<!-- Back Home -->
<a class="nav-back" href="/">
    <i class="fa fa-puzzle-piece"></i>
</a>

<!-- Page Header -->
<header class="intro-header">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <h1>Interface Problem</h1>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">
            <!-- TOC -->
            <div class="toc-article col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
    <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#接口中-id-和-Objective-C-中-id-类型冲突"><span class="toc-text">接口中 id 和 Objective-C 中 id 类型冲突</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Data-中一定要加上-Key"><span class="toc-text">Data 中一定要加上 Key</span></a></li></ol>
</div>

            <!-- Post Main Content -->
            <div class="post-content col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <h3 id="接口中-id-和-Objective-C-中-id-类型冲突"><a href="#接口中-id-和-Objective-C-中-id-类型冲突" class="headerlink" title="接口中 id 和 Objective-C 中 id 类型冲突"></a>接口中 id 和 Objective-C 中 id 类型冲突</h3><ul>
<li>iOS 在 Objective-C 中，id 类型是一个独特的数据类型。</li>
<li>不论入参出参都不可以有 id。</li>
<li>接口中不要返回无意义的 id，name 统一加上业务前缀 employeeId / employeeName</li>
</ul>
<h3 id="Data-中一定要加上-Key"><a href="#Data-中一定要加上-Key" class="headerlink" title="Data 中一定要加上 Key"></a>Data 中一定要加上 Key</h3><ul>
<li>特别是查询列表数据时，防止添加另一个 key-value 时，Data 数据结构要整体变化。</li>
</ul>
<pre><code class="json">{
    &quot;code&quot;: 0,
    &quot;msg&quot;: &quot;success&quot;,
    &quot;data&quot;: {
        &quot;billNoticeList&quot;: [
            {
                &quot;balanceorPayments&quot;: &quot;支出&quot;,
                &quot;amount&quot;: &quot;-2200元&quot;,
                &quot;billType&quot;: &quot;2&quot;,
                &quot;orderNumber&quot;: &quot;hx201710110001&quot;,
                &quot;transactionNumber&quot;: &quot;jx201710110001&quot;,
                &quot;transactionTime&quot;: &quot;2017-10-11&quot;
            },
            {
                &quot;balanceorPayments&quot;: &quot;支出&quot;,
                &quot;amount&quot;: &quot;-20元&quot;,
                &quot;billType&quot;: &quot;0&quot;,
                &quot;orderNumber&quot;: &quot;hx201710110001&quot;,
                &quot;transactionNumber&quot;: &quot;jx201710110001&quot;,
                &quot;transactionTime&quot;: &quot;2017-10-11&quot;
            },
            {
                &quot;balanceorPayments&quot;: &quot;支出&quot;,
                &quot;amount&quot;: &quot;-1200元&quot;,
                &quot;billType&quot;: &quot;1&quot;,
                &quot;orderNumber&quot;: &quot;hx201710110001&quot;,
                &quot;transactionNumber&quot;: &quot;jx201710110001&quot;,
                &quot;transactionTime&quot;: &quot;2017-10-02&quot;
            }
        ],
        &quot;page&quot;: {
            &quot;currentPage&quot;: 1,
            &quot;perPageInt&quot;: 10,
            &quot;startRecord&quot;: 0,
            &quot;endRecord&quot;: 10,
            &quot;totalRecords&quot;: 3,
            &quot;totalPage&quot;: 1,
            &quot;linkUrl&quot;: &quot;&quot;,
            &quot;dataList&quot;: []
        }
    }
}
</code></pre>

 
                <!-- Meta -->
                <div class="post-meta">
                    <hr>
                    <br>
                    <div class="post-tags">
                        
                            

<a href="/tags/Interface/">#Interface</a>


                        
                    </div>
                    <div class="post-date">
                        2017 年 10 月 29 日
                    </div>
                </div>
            </div>

            <!-- Comments -->
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <!-- Disqus Comments -->


            </div>
        </div>
    </div>
</article>
</section>

    <!-- Scripts -->
    <!-- jQuery -->
<script src="//cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

<script type="text/javascript">
	hljs.initHighlightingOnLoad();
	console.log('Hexo-theme-hollow designed by zchen9 http://www.chen9.info © 2015-' + (new Date()).getFullYear());
</script>

    <!-- Google Analytics -->
    

</body>

</html>